/**
 * 
 */
package br.com.ema.maze.factory;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Emanuel Cruz Rodrigues -> emanuelcruzrodrigues@gmail.com
 *
 */
public class MazeFile {
	
	private File file;

	public MazeFile(File file) {
		this.file = file;
	}
	
	public List<String> getFileLines(){
		BufferedReader reader = null;
		List<String> result = new ArrayList<String>();
		try {
			try {
				reader = new BufferedReader(new FileReader(file));
				String line = reader.readLine();
				while (line != null){
					result.add(line);
					line = reader.readLine();
				}
			}finally{
				if (reader != null) reader.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

}
